package com.santi.framework.filemanager.impl;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.Iterator;

import com.santi.framework.filemanager.service.FileIterable;


public class FileReaderImpl implements FileIterable {

	private BufferedReader _reader;
	//private BufferedInputStream _bufferInputStream;

               
	public FileReaderImpl(String fileName) throws Exception {
		URL url = FileReaderImpl.class.getResource("../../resources/"+fileName);
    //System.out.println(".....mmmmmmmmmmmmmmmmmmmmmmmmmmmm.Path......"+url.getPath());
		_reader = new BufferedReader(new InputStreamReader(url.openStream()));
		//_bufferInputStream=new BufferedInputStream()
	}

	public void Close() {
		try {
			_reader.close();
		} catch (Exception ex) {
		}
	}

	public Iterator<String> iterator() {
		return new FileIteratorImpl(_reader);
	}
}
